Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Add project key for agent comms #285

Merged
potofpie merged 15 commits intomainfrom
agents_key
May 14, 2025
Merged

Add project key for agent comms #285
potofpie merged 15 commits intomainfrom
agents_key

Conversation

@potofpie
Copy link
Copy Markdown
Member

@potofpie potofpie commented May 8, 2025

No description provided.

Comment thread cmd/project.go
if envLine.Key == "AGENTUITY_API_KEY" {
envLines[i].Val = apikey
found = true
found["AGENTUITY_API_KEY"] = true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've made this comment several times but it doesn't seem to stick...

AGENTUITY_AGENTS_KEY seems confusing to me. Is this the project-level key for the agent or the key to use for the SDK?

i think we should maybe be more intentional in the naming.

AGENTUITY_SDK_KEY - this would be current AGENTUITY_API_KEY but make it clear that it's needed for the SDK to run.

AGENTUITY_PROJECT_KEY - this would be what I think is your AGENTUITY_AGENTS_KEY but be the project-level key for accessing agents within the same project.

We would need to make AGENTUITY_API_KEY backwards compatible so i realize that this is a little more work but i think would make it more clear what is what.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Yep! I was in the process of making that change Thursday and and pick it back up now. 👍

@potofpie potofpie changed the title Agents key Add project key for agent comms May 12, 2025
@potofpie potofpie requested a review from jhaynie May 12, 2025 18:36
Copy link
Copy Markdown
Member

@jhaynie jhaynie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread cmd/project.go
"AGENTUITY_PROJECT_KEY": false,
}

for i, envLine := range envLines {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

Comment thread cmd/project.go Outdated

if !found["AGENTUITY_SDK_KEY"] {
envLines = append(envLines, env.EnvLine{Key: "AGENTUITY_SDK_KEY", Val: apikey})
gtVersion := version.GreaterThan(semver.MustParse("0.0.114"))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

different versions between python and js.

Comment thread cmd/project.go

if !found["AGENTUITY_PROJECT_KEY"] {
envLines = append(envLines, env.EnvLine{Key: "AGENTUITY_PROJECT_KEY", Val: projectKey})
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm wondering if we need all of this. since this version of the CLI that's executing and our network will support the new variable, why not just detect if we have the old one and remove it and replace it with the new one and not worry about the SDK version at all?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I think that would work for deployed projects but we'd something like this for devmode.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can think of a simpler way to solve that problem tho.

@potofpie potofpie marked this pull request as ready for review May 13, 2025 14:27
@potofpie potofpie requested a review from jhaynie May 13, 2025 14:41
@potofpie potofpie requested review from pec1985 and robindiddams May 13, 2025 16:44
Comment thread internal/bundler/upgrade.go Outdated
Runtime: "bunjs",
Version: "<0.0.115",
Title: "🚫 JS SDK Breaking Change 🚫",
Message: "The environment variable and code reference for your Agentuity API key has changed from AGENTUITY_API_KEY to AGENTUITY_SDK_KEY. Update all occurrences in your .env files and codebase. See the v0.0.114 Changelog for details.\n\n" + tui.Link("https://agentuity.dev/Changelog/sdk-js#v00114") + "\n\nAfter migrated, please run bun update @agentuity/sdk --latest and then re-run this command again.",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the message be 0.0.115?

Comment thread internal/bundler/upgrade.go Outdated
Runtime: "nodejs",
Version: "<0.0.115 ",
Title: "🚫 JS SDK Breaking Change 🚫",
Message: "The environment variable and code reference for your Agentuity API key has changed from AGENTUITY_API_KEY to AGENTUITY_SDK_KEY. Update all occurrences in your .env files and codebase. See the v0.0.114 Changelog for details.\n\n" + tui.Link("https://agentuity.dev/Changelog/sdk-js#v00114") + "\n\nAfter migrated, please run npm i @agentuity/sdk --latest and then re-run this command again.",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Comment thread internal/bundler/upgrade.go Outdated
Runtime: "uv",
Version: "<0.0.84",
Title: "🚫 Python SDK Breaking Changes 🚫",
Message: "The environment variable and code reference for your Agentuity API key has changed from AGENTUITY_API_KEY to AGENTUITY_SDK_KEY. Update all occurrences in your .env files and codebase. See the v0.0.114 Changelog for details.\n\n" + tui.Link("https://agentuity.dev/Changelog/sdk-js#v00114") + "\n\nAfter migrated, please run `uv add agentuity -U` --latest and then re-run this command again.",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix version

@potofpie potofpie requested a review from jhaynie May 13, 2025 18:03
Comment thread internal/bundler/upgrade.go Outdated
Runtime: "nodejs",
Version: "<0.0.115 ",
Title: "🚫 JS SDK Breaking Change 🚫",
Message: "The environment variable and code reference for your Agentuity API key has changed from AGENTUITY_API_KEY to AGENTUITY_SDK_KEY. Update all occurrences in your .env files and codebase. See the v0.0.115 Changelog for details.\n\n" + tui.Link("https://agentuity.dev/Changelog/sdk-js#v00114") + "\n\nAfter migrated, please run npm i @agentuity/sdk --latest and then re-run this command again.",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link is wrong on these still

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dammit my bad.

@potofpie potofpie requested a review from jhaynie May 13, 2025 22:52
Copy link
Copy Markdown
Member

@jhaynie jhaynie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Copy link
Copy Markdown
Contributor

@robindiddams robindiddams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

Comment thread cmd/project.go Outdated
Comment thread cmd/project.go
Co-authored-by: Robin Diddams <robindiddams@gmail.com>
Co-authored-by: Robin Diddams <robindiddams@gmail.com>
@potofpie potofpie merged commit 7040e58 into main May 14, 2025
14 checks passed
@potofpie potofpie deleted the agents_key branch May 14, 2025 12:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants